/// Provides components that bring together all file saving/loading plugins into a single component, so that you don't need to explicitly locate which component to use. This also provides the filename type.
#include <pryn.h>
#include <pryn/types/file.h>

PrynType *prynFileType;
PrynFactory *prynInputFactory;
PrynFactory *prynOutputFactory;

PrynLibraryEntryPoint (PrynLibrary *library)
{
	PrynType *type = 0;
	PrynFactory *factory = 0;
	PrynResult result = 0;
	
	prynSetLibraryNameLiteral (library, "Input/output");
	prynSetLibraryDescriptionLiteral (library, "This provides input and output components for loading and saving objects from and to files, and a file type.");
	
	result = prynCreateType (library, &type, prynStringLiteral ("Pryn.File"));
	if (result < 0) return result;
	prynFileType = type;
	
	prynSetTypeNameLiteral (type, "File");
	prynSetTypeDescriptionLiteral (type, "A file on the filesystem.");

	result = prynCreateFactory (&factory, library, prynStringLiteral ("Pryn.Input"));
	if (result < 0) return result;
	prynInputFactory = factory;
	
	prynFactorySetNameLiteral (factory, "Input");
	prynFactorySetDescriptionLiteral (factory, "Loads objects from files by transparently hooking into other components.");
	
	result = prynCreateFactory (&factory, library, prynStringLiteral ("Pryn.Output"));
	if (result < 0) return result;
	prynOutputFactory = factory;
	
	prynFactorySetNameLiteral (factory, "Output");
	prynFactorySetDescriptionLiteral (factory, "Saves objects to files by transparently hooking into other components.");
	
	return result;
}
